<template>
    <view class="intro">
        <rich-text nodes="{{htmlShow}}"></rich-text>
    </view>
</template>
<script>
    import wepy from 'wepy';
    import api from '@/api/api';
    import utils from '@/utils/utils';
    import tip from '@/utils/tip';
    import {
        USER_INFO,USER_SPECICAL_INFO
    } from '@/utils/constant';

    export default class intro extends wepy.page {
        config = {  // 配置当前页面
            navigationBarTitleText: '用户协议',    // 头部标题
        }
        components = {

        }
        data = {
            htmlShow:''
        }
        async getGuideList() {
            let self = this;
            api.artGetByType({},"SALE").then(function(res){
                if (res.data.code == 0) {
                    self.htmlShow = res.data.data[0].content.replace(/\<img/gi, '<img style="width:100%;height:auto" ');
                    self.$apply();
                } else {
                    tip.error(res.data.msg)
                }
            });
        }
        onLoad(){
            this.getGuideList()
        }
        methods = {
            htmlEscape(html) {
                var reg = /(&lt;)|(&gt;)|(&amp;)|(&quot;)/g;
                return html.replace(reg, function (match) {
                    switch (match) {
                        case "&lt;":
                            return "<";
                        case "&gt;":
                            return ">"
                        case "&amp;":
                            return "&";
                        case "&quot;":
                            return "\""
                    }
                });

            }
        }
        events = {

        }
    }

</script>
<style lang="less">
    .intro{
        padding: 20rpx;
    }
</style>
